// ActionScript file
// TASKBAR

private function resizeTaskbar():void {
	if(taskbar){
		taskbar.y = screen.height-94;
		taskbar.width = screen.width - 2;
		googleImage.x = screen.width - 160;
		googleInput.x = screen.width - 160;
		rapidshareImage.x = screen.width - 160;
		rapidshareInput.x = screen.width - 160;
		wikipediaImage.x = screen.width - 160;
		wikipediaInput.x = screen.width - 160;
		if(panels[1]){
			panels[1].x = screen.width-202;
			panels[1].y = screen.height-380;
		}
		if(tip=="0"){
			panels[2].x = screen.width-402;
			panels[2].y = screen.height-380;
		}
	}
}

public function taskbarButtonClicked(event:MouseEvent):void {
	var counter:Number;
	for(var i:Number=0; i<panels.length; i++){
		if(event.target.label==panels[i].title) counter = i;
	}
	addChild(panels[counter]);
	taskbar.removeChild(panels[counter].backButton);
}
	
public function taskbarButtonRightClicked(event:MouseEvent):void {
	var counter:Number;
	for(var i:Number=0; i<panels.length; i++){
		if(event.target.label==panels[i].title) counter = i;
	}
	panels[counter].title = "INVISIBLE";
	panels[counter].name = "INVISIBLE";
	taskbar.removeChild(panels[counter].backButton);
}

public function checkExist(str:String):Boolean{
	for(var i:Number=0; i<panels.length; i++){
		if(str==panels[i].title) return true;
	}
	return false;
}